The commands used in creating a ZIP file will be explained in detail in this section. You will find that the new command format is much more flexible and easier to use. Listed below is a summary of important facts to keep in mind while using PKZIP.
- The command options can generally be placed anywhere on the command line.
- The first filename listed on the command line will be interpreted as the
ZIP file.
- The command can be typed using either upper case, lower case, or any
combination.
- All command options for the software must be preceded by a '-' character
or the MS-DOS switch character (usually '/').
- Most options except where noted can be combined (i.e. "-x -y"
or "-xy").
- The default values for the command line are as follows:
- If no options are entered, the default is '-a', the add file option.
- If no extension is specified for the ZIP file the .ZIP extension will
be used.
- If no location is listed for the ZIP file, it will be located in the
current directory.
- If no file specs (filenames, with or without wildcards) are listed, the
default is *.* (unless the -d option is being used).
The following table lists all the options valid with the PKZIP command. A
brief summary is also given in the table. The options are explained in
detail, along with programming examples, following the table.
Table 3-1 PKZIP Command Options
Option Summary
-a Adds files to ZIP file.
-b[path] Creates a temporary ZIP file at the specified alternate
location. This temporary file is used only in the
creation of the ZIP file, and will be automatically
deleted when the process is complete.
-c Adds file comments to individual files within the ZIP
file. Not implemented in first release.
-d Deletes the specified files from the ZIP file.
-e[a,b][n] Specifies extra compression method.
-f Freshens files in the ZIP file.
-g Encrypts files in the ZIP file. Not implemented in
first release.
-h Calls up a help screen.
-i Backs up only the files that were not backed up the
last time.
-l Displays the license screen.
-m Adds files to the ZIP file and automatically deletes
the original or source files.
-o Sets time and date of the ZIP file to the time and date
of the latest file contained in the ZIP file.
-p Stores relative paths with the filenames in the ZIP
file. Should be used with -r option below.
-r Recurses subdirectories from the specified directories.
-u Updates the ZIP file.
-v[t][r/s/d/n] Views technical information about files in the ZIP
file. The files can be sorted by compression Ratio,
Size, Date, or alphabetically by Name.
There are several size factors you must be aware of when using the PKZIP
command. A ZIP file can hold any number of files subject to the storage
size of your disk. You NEED unused storage space at least equal to the
size of the existing ZIP file in order to complete any updating process.
For example, if the ZIP file to be updated is currently 250K, you need
250K for actual storage space and another 250K for the updating process.
This is because PKZIP does not delete the original ZIP file until the
new updated ZIP file has been created. So at the instant the new
updated ZIP file is completed the original ZIP file will still exist.
Therefore, you would need disk storage space twice the actual size of
the ZIP file.
If this poses a problem to you, it can be counteracted by using the -b
command. This process is explained in greater detail later in this
section.
This section will give a detailed explanation of the command options
used in the PKZIP command. Recall that except where noted, several
options can be combined on the command line, and the options can be
placed in any order.
The command options are explained in groups determined by function. The
options pertaining to adding or updating ZIP files are explained first,
followed by the delete option, view options and miscellaneous options.
-a Add files to a ZIP file
This command will add files to either a NEWLY CREATED or EXISTING
ZIP file. Same-name files will overwrite those already in the ZIP
file regardless of which has the latest date. This is the default
option if no other options are specified.
A:>PKZIP -a Arrange Flowers.Txt Pictures.Wks Pots.Dbs
Once the program is finished creating a new ZIP file, the extension
.ZIP will be added to "Arrange" making it Arrange.ZIP
-u Update existing ZIP file
The existing ZIP file will be updated with files only if they are
not currently in the ZIP file, or if they are dated later than those
with the same name already in the ZIP file.
Although this command is similar to the -a Add command, it has an
update SAFEGUARD. It will overwrite existing compressed files ONLY
if the selected files have the most recent time and date.